package stringTest;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: tao
 * Date: 2023-11-21
 * Time: 9:44
 */
public class Test4 {
    public static void main(String[] args) {
        String s1 = "hello";
        //字符串转数组
        char[] ch = s1.toCharArray();
        for(char x :ch) {
            System.out.print(x + " ");
        }
        System.out.println();
        //数组转字符串
        String s2 = new String(ch);
        System.out.println(s2);
    }
}
